package com.engine.update.cmd;

import com.engine.core.interceptor.JdbcCommandContext;
import com.engine.core.interceptor.ResponseCommand;
import com.engine.core.util.Response;
import com.engine.system.User;

import java.util.Map;

public class DeleteMultiCommand extends ResponseCommand {


    public DeleteMultiCommand(User user, Map<String, Object> params) {
        super(user, params);
    }

    /**
     * @param commandContext
     * @return
     * @throws Exception
     */
    @Override
    public Response execute(JdbcCommandContext commandContext) throws Exception {
        Response response=Response.static_success("执行成功!");
        try {
//            String datas=(String)params.get(QueryUtil.QUERY_CONTENT);
//            JdbcTemplate jdbcTemplate=commandContext.getJdbcTemplate();
//            String tableName= JSONObject.parseObject(datas).getString(QueryUtil.QUERY_TABLE);
//            GenTable genTable= Mysql.getTable(tableName,jdbcTemplate);
//            List<Map<String,Object>> dataList= JdbcTypeBiz.getUpdateDataByDB(datas,commandContext.getGlobal().getDateformat(),jdbcTemplate);
//            LinkedHashMap<String, MappedType> mappedTypeMap=JdbcTypeBiz.getUpdateParamsTypeByDB(datas,jdbcTemplate);
//            Map<String,String> othersMap=JdbcTypeBiz.getUpdateOthersByContent(datas);
//            response=JdbcTemplateUtils.deleteDataByWhere(genTable,jdbcTemplate,dataList,mappedTypeMap,othersMap);
        }catch (Exception e) {
            response.setErr(e);
        }
        return response;
    }
}
